package org.one.afternoon.service.impl;

import org.one.afternoon.domain.Category;
import org.one.afternoon.mapper.CategoryMapper;
import org.one.afternoon.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryMapper categoryMapper;

    @Override
    public List<Category> findAll() {
        return categoryMapper.findAll();
    }

    @Override
    public List<Category> queryOne(Category category) {
        return categoryMapper.queryOne(category);
    }

    @Override
    public boolean insert(Category category) {
        return categoryMapper.insert(category);
    }

    @Override
    public boolean deleteById(Integer index) {
        return categoryMapper.delete(index);
    }

    @Override
    public boolean update(Category category) {
        return categoryMapper.update(category);
    }
}
